<?php

use common\helpers\Html;
use common\models\backend\AdminBank;
use common\models\member\Recharge;
use yii\widgets\ActiveForm;
$form = ActiveForm::begin([
    'id' => $model->formName(),
    // 'enableAjaxValidation' => true,
    // 'validationUrl' => Url::to(['handle', 'id' => $id]),
    // 'fieldConfig' => [
    //     'template' => "<div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}\n{hint}\n{error}</div>",
    // ]
]);
?>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<div class="modal-body">
    <div class="first"> 
        <table class="table table-striped table-bordered detail-view">
            <tbody>
            <tr>
                <td>订单编号</td>
                <td><?= Html::encode($model['order_sn']) ?></td>
                <td>会员账号</td>
                <td><?= Html::encode($model['member']['username']) ?></td>
            </tr>
            <tr>
                <td>充值方式</td>
                <td><?= Html::encode( AdminBank::getPayType($model['action_type']) ) ?></td>
                <td>金额</td>
                <td><?= Html::encode($model['amount']) ?></td>
            </tr>
            <tr>
                <td>收款名称</td>
                <td><?= Html::encode($model['bank_name']) ?></td>
                <td>收款姓名</td>
                <td><?= Html::encode($model['bank_user_name']) ?></td>
            </tr>
            <tr>
                <td>收款账号</td>
                <td><?= Html::encode($model['address']) ?></td>
                <td>提交时间</td>
                <td><?= Html::encode($model['created_at']) ?></td>
            </tr>
            <tr>
                <td>处理结果：</td>
                <td>
                    <select name="type" id="type" class="zhi"> 
                    <option value="2">批准</option> 
                    <option value="3">不批准</option> 
                    <option id="abc" class="hidden" value="<?= $model->id ?>"><?= $model->id ?></option> 
                    </select> 
                </td>
                <td id="name" style="display: none;">请说明原因：</td>
                <td id="bz" style="display: none;"><textarea id="text"></textarea></td>
            </tr>
            </tbody>
        </table>
    </div>
    
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
    <button type="button" class="btn btn-success bc">保存</button>

    <!-- <button class="btn btn-primary tijiao"  type="submit">下一步</button> -->
</div>
<script type="text/javascript">
$("#type").change(function() { 
    var type = $('#type').val();
    if (type == 3) {
        $('#bz').show();
        $('#name').show();
    }else{
        $('#name').hide();
        $('#bz').hide();

    }
    
});
</script>